﻿using System;
using System.Collections.Generic;

namespace timetable
{
    class ChoiceTree
    {
        public int courseNumber = 10;
        private List<List<char>> rawChoice;
        private BinaryTree<char> _binaryTree = new BinaryTree<char>();
        public BinaryTreeNode<char> root; 

        public ChoiceTree()
        {
            _binaryTree.Root = new BinaryTreeNode<char>('0');
            root = _binaryTree.Root;
            initTree(_binaryTree.Root, 0);            
        }

        /**
         * 完成二叉树的构建
         **/
        public void initTree(BinaryTreeNode<char> t,int height)
        {

            if (height < 2)
            {
                t.Left = new BinaryTreeNode<char>('A');
                t.Right = new BinaryTreeNode<char>('B');
                initTree(t.Left,height+1);
                initTree(t.Right,height+1);  
            }
 
        }

        //中序遍历
        public void PostorderTraversal(BinaryTreeNode<char> current)
        {
            if (current != null)
            {
                // Output the value of the current node
                Console.WriteLine(current.Value);
                
                // Visit the left child...
                PostorderTraversal(current.Left);
                
                // Visit the right child...
                PostorderTraversal(current.Right);
            }
        }

         
    }
}
